/**
 * 
 */
package com.apache.portal.common.connector.impl;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.apache.api.vo.ParamsVo;
import com.apache.portal.common.annotion.AnntationBean;
import com.apache.portal.common.connector.BeforlerInterceptorAdapter;
import com.apache.tools.StrUtil;

/**
 * 发送验证码
 */
@AnntationBean(name = "sendCodeAdapter")
public class SendCodeAdapterImpl extends BeforlerInterceptorAdapter {

	/* (non-Javadoc)
	 */
	@Override
	public boolean beforPreHandle(HttpServletRequest request, HttpServletResponse response, ParamsVo param) {

		if ((StrUtil.isNull(request.getParameter("emailCode")))) {
			return false;
		}
		String randCode = String.valueOf(request.getSession().getAttribute("mailCode"));
		if (!request.getParameter("emailCode").equals(randCode)) {
			return false;
		}
		return false;
	}
}
